package be.gnx.event.consumer.receiver;

public abstract class Receiver implements Runnable {

    private final EventProcessor eventProcessor;
	private Thread thread;

    public Receiver(EventProcessor eventProcessor) {
    	this.eventProcessor = eventProcessor;
    }

	public EventProcessor getEventProcessor() {
		return eventProcessor;
	}

	public void start(boolean daemon) {
		thread = new Thread(this);
		thread.setDaemon(daemon);
		thread.start();
	}

	public void stop() {
		thread.interrupt();
	}

}
